export interface SqlNode {
    type: "select" | "binary_expr" | "column_ref"
}

export interface ColumnRef extends SqlNode {
    column: string
    table: string
    parentheses: boolean
}

export interface SelectStatement extends SqlNode {
    columns: string
    from: SqlSource
    where: BinaryExpression
    _next: SelectStatement
    groupby: GroupBy[]
    orderby: OrderBy[]
    limit: Limit[]
}

export interface Limit extends SqlNode {

}

export interface OrderBy extends SqlNode {
    expr: SqlNode
}

export interface GroupBy extends SqlNode {

}

export interface SqlSource extends SqlNode {

}

export interface BinaryExpression extends SqlNode {
    type: "binary_expr"
    operator: string,
    left: SqlNode
    right: SqlNode
}

export interface AverageExpression extends SqlNode {
    name: string, quantifier: string, args: any
}